<template>
  <div>
    小明的成绩:
    <p>语文: {{ score1 }} </p>
    <p>数学: {{ score2 }} </p>
    <!-- <p>英语: {{ score1 + score2 }} </p> -->
    <!-- 使用计算 -->
    <p>英语: {{ totaScore }} </p> 
  </div>
</template>

<script>
export default {
  data() {
    return {
      score1: 90,
      score2: 80
    };
  },
  methods: {
    getTotal() {
      console.log('我是 getTotal')
      return this.score1 + this.score2
    }
  },
  computed: {
    totaScore() {
      console.log('我是 totaScore')
      return this.score1 + this.score2
    }
  }
};
</script>

<style lang="scss" scoped>

</style>